﻿@model Parichay.Domain.MemberRequests

@{
    ViewBag.Title = "Acknowledge";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script src="@Url.Content("~/Content/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend><h2>Acknowledge Member Request</h2></legend>
        <table class="tblAllBorders">
@if (Model.IsRecipient)
{    
       <tr><th><div class="editor-label">
           @Html.LabelFor(model => model.Senderid)
           @Html.HiddenFor(model => model.Senderid.Id)
        </div>
        </th><td><div class="editor-field">
          <ul class="bullet-arrow">
           <li><img src="@Url.Action("Avatar", "Media", new { id = Model.Senderid.PicId })" alt="" /></li>
           <li>Name: @Html.DisplayFor(model => model.Senderid.Givennm)</li>
           <li>Institute: @Html.DisplayFor(model => model.Senderid.Institute)</li> 
           <li>Dept: @Html.DisplayFor(model => model.Senderid.Dept)</li>
            </ul>
        </div></td></tr>
}
else
{
    <tr><th><div class="editor-label">
           @Html.LabelFor(model => model.Recipientid)
           @Html.HiddenFor(model => model.Recipientid.Id)
        </div>
        </th><td><div class="editor-field">
          <ul class="bullet-arrow">
           <li><img src="@Url.Action("Avatar", "Media", new { id = Model.Recipientid.PicId })" alt="" /></li>
           <li>Name: @Html.DisplayFor(model => model.Recipientid.Givennm)</li>
           <li>Institute: @Html.DisplayFor(model => model.Recipientid.Institute)</li> 
           <li>Dept: @Html.DisplayFor(model => model.Recipientid.Dept)</li>
            </ul>
        </div></td></tr>
}
        

        <tr><th><div class="editor-label">
            @Html.LabelFor(model => model.Guid)
        </div>
        </th><td><div class="editor-field">
            @Html.DisplayFor(model => model.Guid) @Html.HiddenFor(model => model.Guid)
            @Html.ValidationMessageFor(model => model.Guid)
        </div></td></tr>

        @*<tr><th><div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        </th><td><div class="editor-field">
            @Html.DisplayFor(model => model.Email) @Html.HiddenFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div></td></tr>*@


        <tr><th><div class="editor-label">
            @Html.LabelFor(model => model.Createdate)
        </div>
        </th><td><div class="editor-field">
            @Html.DisplayFor(model => model.Createdate) @Html.HiddenFor(model => model.Createdate)
            @Html.ValidationMessageFor(model => model.Createdate)
        </div></td></tr>

        <tr><th><div class="editor-label">
            @Html.LabelFor(model => model.Version)
        </div>
        </th><td><div class="editor-field">
            @Html.DisplayFor(model => model.Version)
            @Html.ValidationMessageFor(model => model.Version)
        </div></td></tr>
        @if (Model.IsRecipient)
        {
        <tr><td><input name="submitButton" value="Accept" type="submit" onclick="if(!confirm('Would you like to accept this request?')){return false;}" /></td><td><input name="submitButton" value="Decline" type="submit" onclick="if(!confirm('Would you like to decline this request?')){return false;}"  /></td></tr>
        }
        else
        {
            <tr><td colspan="2"><input name="submitButton" value="Hide" type="submit" onclick="if(!confirm('This request has not been accepted yet. It will be automatically hidden once accepted. However, you can still hide it. You will receive a notification if the request is accepted. Would you like to proceed?')){return false;}"  /></td></tr>
        }
        </table>

    </fieldset>
}

<div>
    @Html.ActionLink("Back to Home", "Index", "Account")
</div>
